layout (location = 0) out vec4 eceGlPosition;
layout (location = 1) out vec4 eceGlNormal;
layout (location = 2) out vec4 eceGlAlbedoSpec;
layout (location = 3) out vec4 eceGlGameData;

uniform ece_Material material;
uniform sampler2D texture;
uniform bool existTexture;
varying vec2 vTexCoord;
varying vec3 vNormal;
varying vec3 vPosition;
varying float vDistance;
void main() {
	vec4 baseColor = existTexture ? texture2D(texture, vTexCoord) : vec4(1, 1, 1, 1);
	eceGlPosition.rgb = vPosition;
	eceGlPosition.a = vDistance;
	eceGlNormal.rgb = vNormal;
	eceGlNormal.a = material.enable ? material.shininess : 24;
	eceGlAlbedoSpec.rgb = material.enable ? baseColor.rgb * material.diffuse : baseColor.rgb;
	eceGlAlbedoSpec.a = material.specular.r;
	eceGlGameData.r = 0;
}